import hotList from '../../res/data';
import router from '@ohos.router';
export default {
    data: {
        hotList:[],
        noteData:{},
        content:`<div class="flex-direction: column; background-color: #ffffff; padding: 30px; margin-bottom: 30px;"  style="background-color: #FFFFFF">
      <style>h1{color: yellow;}</style>
      <p class="item-title">h1</p>
      <h1>文本测试(h1测试)</h1>
      <p class="item-title">h2</p>
      <h2>文本测试(h2测试)</h2>
    </div>`

    },
    onInit() {
        // 从路由上获取参数
        let id = router.getParams()['id']
        //根据id，查询当前页面的数据
        this.noteData = hotList.filter((obj)=> obj.id == id)[0]

        // this.noteData = hotList[0]
    },
    onLoadStart() {
        console.error("start load rich text:" + JSON.stringify())
    },
    onLoadEnd() {
        console.error("end load rich text:" + JSON.stringify())
    },
    back(){
        router.back()
    }
}
